package com.example.entity;

import java.time.LocalDateTime;
import jakarta.persistence.*;
import org.apache.ibatis.type.Alias;

@Entity
@Table(name = "edit_sessions")
@Alias("EditSession")
public class EditSession {
    @Id
    @Column(name = "session_id", length = 64)
    private String sessionId;
    
    @Column(name = "document_id", nullable = false)
    private Integer documentId;
    
    @Column(name = "editor_username", nullable = false, length = 255)
    private String editorUsername;
    
    @Column(name = "is_active")
    private Boolean isActive;
    
    @Column(name = "start_time")
    private LocalDateTime startTime;
    
    @Column(name = "last_activity")
    private LocalDateTime lastActivity;


    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public Integer getDocumentId() {
        return documentId;
    }

    public void setDocumentId(Integer documentId) {
        this.documentId = documentId;
    }

    public String getEditorUsername() {
        return editorUsername;
    }

    public void setEditorUsername(String editorUsername) {
        this.editorUsername = editorUsername;
    }

    public Boolean getIsActive() {
        return isActive;
    }

    public void setIsActive(Boolean isActive) {
        this.isActive = isActive;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getLastActivity() {
        return lastActivity;
    }

    public void setLastActivity(LocalDateTime lastActivity) {
        this.lastActivity = lastActivity;
    }
}